package com.itheima.iterator;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

public class IteratorDemo05 {
    public static void main(String[] args) {
        List<String> list = new ArrayList<>();
        list.add("a");
        list.add("b");
        list.add("c");
        list.add("d");
        System.out.println(list);//[a, b, c, d]

        String remove = list.remove(3);
        System.out.println(remove);//d
        System.out.println(list);//[a, b, c]

        System.out.println("-----------");

        String a = list.set(0, "A");
        System.out.println(a);//a
        System.out.println(list);//[A, b, c]

        System.out.println("-----------");

        String s = list.get(2);
        System.out.println(s);//c

    }
}
